package p270jp.pxv.android.pixivision.presentation.flux;

import androidx.lifecycle.AbstractC0720j0;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import p023an.Intrinsics;
import p047bg.C1124a;
import p054bn.AbstractC1131c;
import p054bn.AbstractC1136i;
import p054bn.DebugMetadata;
import p060c2.Chain;
import p064c6.Preconditions;
import p090d0.C2518n;
import p189gn.AbstractC3450p;
import p325m0.MutabilityOwnership;
import p493sf.AbstractC6048h;
import p493sf.FluxUtils;
import p501sn.CoroutineScope;
import p578vn.AbstractC6853b;
import p578vn.AbstractC6861n;
import p578vn.FlowCollector;
import p578vn.Share;
import p578vn.SharedFlow;
import p603wm.Unit;
import p627xk.PixivisionListEvent;
import p627xk.PixivisionListState;
import p681zm.Continuation;

/* compiled from: PixivisionListStore.kt */
/* renamed from: jp.pxv.android.pixivision.presentation.flux.PixivisionListStore */
/* loaded from: classes2.dex */
public final class PixivisionListStore extends AbstractC0720j0 {

    /* renamed from: c */
    public final AbstractC6048h f19289c;

    /* renamed from: d */
    public final MutableLiveData<PixivisionListState> f19290d;

    /* renamed from: e */
    public final LiveData<PixivisionListState> f19291e;

    /* renamed from: f */
    public final SharedFlow<PixivisionListEvent> f19292f;

    /* renamed from: g */
    public final AbstractC6861n<PixivisionListEvent> f19293g;

    /* compiled from: PixivisionListStore.kt */
    @DebugMetadata(m10153c = "jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$1", m10152f = "PixivisionListStore.kt", m10151l = {48}, m10150m = "invokeSuspend")
    /* renamed from: jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a */
    /* loaded from: classes2.dex */
    public static final class C4308a extends AbstractC1136i implements AbstractC3450p<CoroutineScope, Continuation<? super Unit>, Object> {

        /* renamed from: a */
        public int f19294a;

        /* compiled from: Collect.kt */
        /* renamed from: jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a$a */
        /* loaded from: classes2.dex */
        public static final class C4309a implements FlowCollector<FluxUtils> {

            /* renamed from: a */
            public final /* synthetic */ PixivisionListStore f19296a;

            @DebugMetadata(m10153c = "jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$1$invokeSuspend$$inlined$collect$1", m10152f = "PixivisionListStore.kt", m10151l = {140}, m10150m = "emit")
            /* renamed from: jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a$a$a */
            /* loaded from: classes2.dex */
            public static final class C4310a extends AbstractC1131c {

                /* renamed from: a */
                public /* synthetic */ Object f19297a;

                /* renamed from: b */
                public int f19298b;

                public C4310a(Continuation dVar) {
                    super(dVar);
                }

                @Override // p054bn.ContinuationImpl
                public final Object invokeSuspend(Object obj) {
                    this.f19297a = obj;
                    this.f19298b |= Integer.MIN_VALUE;
                    return C4309a.this.mo924a(null, this);
                }
            }

            public C4309a(PixivisionListStore pixivisionListStore) {
                this.f19296a = pixivisionListStore;
            }

            /* JADX WARN: Removed duplicated region for block: B:10:0x0021  */
            /* JADX WARN: Removed duplicated region for block: B:14:0x002f  */
            @Override // p578vn.FlowCollector
            /* renamed from: a */
            /* Code decompiled incorrectly, please refer to instructions dump */
            public java.lang.Object mo924a(p493sf.FluxUtils r5, p681zm.Continuation<? super p603wm.Unit> r6) {
                /*
                    r4 = this;
                    boolean r0 = r6 instanceof p270jp.pxv.android.pixivision.presentation.flux.PixivisionListStore.C4308a.C4309a.C4310a
                    if (r0 == 0) goto L_0x0013
                    r0 = r6
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a$a$a r0 = (p270jp.pxv.android.pixivision.presentation.flux.PixivisionListStore.C4308a.C4309a.C4310a) r0
                    int r1 = r0.f19298b
                    r2 = -2147483648(0xffffffff80000000, float:-0.0)
                    r3 = r1 & r2
                    if (r3 == 0) goto L_0x0013
                    int r1 = r1 - r2
                    r0.f19298b = r1
                    goto L_0x0018
                L_0x0013:
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a$a$a r0 = new jp.pxv.android.pixivision.presentation.flux.PixivisionListStore$a$a$a
                    r0.<init>(r6)
                L_0x0018:
                    java.lang.Object r6 = r0.f19297a
                    an.a r1 = p023an.Intrinsics.COROUTINE_SUSPENDED
                    int r2 = r0.f19298b
                    r3 = 1
                    if (r2 == 0) goto L_0x002f
                    if (r2 != r3) goto L_0x0027
                    p060c2.Chain.m9951I(r6)
                    goto L_0x008e
                L_0x0027:
                    java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
                    java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
                    r5.<init>(r6)
                    throw r5
                L_0x002f:
                    p060c2.Chain.m9951I(r6)
                    sf.a r5 = (p493sf.FluxUtils) r5
                    boolean r6 = r5 instanceof p627xk.PixivisionListAction.C7163a
                    if (r6 == 0) goto L_0x004b
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore r6 = r4.f19296a
                    androidx.lifecycle.x<xk.e> r6 = r6.f19290d
                    xk.e$a r0 = new xk.e$a
                    xk.a$a r5 = (p627xk.PixivisionListAction.C7163a) r5
                    java.util.List<jp.pxv.android.model.Pixivision> r1 = r5.f30091a
                    java.lang.String r5 = r5.f30092b
                    r0.<init>(r1, r5)
                    r6.m11032n(r0)
                    goto L_0x008e
                L_0x004b:
                    boolean r6 = r5 instanceof p627xk.PixivisionListAction.C7164b
                    if (r6 == 0) goto L_0x0065
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore r6 = r4.f19296a
                    vn.i<xk.d> r6 = r6.f19292f
                    xk.d$a r2 = new xk.d$a
                    xk.a$b r5 = (p627xk.PixivisionListAction.C7164b) r5
                    jp.pxv.android.model.Pixivision r5 = r5.f30093a
                    r2.<init>(r5)
                    r0.f19298b = r3
                    java.lang.Object r5 = r6.mo924a(r2, r0)
                    if (r5 != r1) goto L_0x008e
                    return r1
                L_0x0065:
                    boolean r6 = r5 instanceof p627xk.PixivisionListAction.C7165c
                    if (r6 == 0) goto L_0x0073
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore r5 = r4.f19296a
                    androidx.lifecycle.x<xk.e> r5 = r5.f19290d
                    xk.e$b r6 = p627xk.PixivisionListState.C7171b.f30107a
                    r5.m11032n(r6)
                    goto L_0x008e
                L_0x0073:
                    boolean r6 = r5 instanceof p627xk.PixivisionListAction.C7166d
                    if (r6 == 0) goto L_0x0081
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore r5 = r4.f19296a
                    androidx.lifecycle.x<xk.e> r5 = r5.f19290d
                    xk.e$c r6 = p627xk.PixivisionListState.C7172c.f30108a
                    r5.m11032n(r6)
                    goto L_0x008e
                L_0x0081:
                    boolean r5 = r5 instanceof p627xk.PixivisionListAction.C7167e
                    if (r5 == 0) goto L_0x008e
                    jp.pxv.android.pixivision.presentation.flux.PixivisionListStore r5 = r4.f19296a
                    androidx.lifecycle.x<xk.e> r5 = r5.f19290d
                    xk.e$d r6 = p627xk.PixivisionListState.C7173d.f30109a
                    r5.m11032n(r6)
                L_0x008e:
                    wm.j r5 = p603wm.Unit.f29503a
                    return r5
                */
                throw new UnsupportedOperationException("Method not decompiled: p270jp.pxv.android.pixivision.presentation.flux.PixivisionListStore.C4308a.C4309a.mo924a(java.lang.Object, zm.d):java.lang.Object");
            }
        }

        public C4308a(Continuation<? super C4308a> dVar) {
            super(2, dVar);
        }

        @Override // p054bn.ContinuationImpl
        public final Continuation<Unit> create(Object obj, Continuation<?> dVar) {
            return new C4308a(dVar);
        }

        @Override // p189gn.AbstractC3450p
        public Object invoke(CoroutineScope d0Var, Continuation<? super Unit> dVar) {
            return new C4308a(dVar).invokeSuspend(Unit.f29503a);
        }

        @Override // p054bn.ContinuationImpl
        public final Object invokeSuspend(Object obj) {
            Intrinsics aVar = Intrinsics.COROUTINE_SUSPENDED;
            int i = this.f19294a;
            if (i == 0) {
                Chain.m9951I(obj);
                AbstractC6853b<FluxUtils> a = PixivisionListStore.this.f19289c.mo2434a();
                C4309a aVar2 = new C4309a(PixivisionListStore.this);
                this.f19294a = 1;
                if (a.mo1092c(aVar2, this) == aVar) {
                    return aVar;
                }
            } else if (i == 1) {
                Chain.m9951I(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            return Unit.f29503a;
        }
    }

    public PixivisionListStore(AbstractC6048h hVar) {
        MutabilityOwnership.m3745m(hVar, "dispatcher");
        this.f19289c = hVar;
        MutableLiveData<PixivisionListState> xVar = new MutableLiveData<>();
        this.f19290d = xVar;
        this.f19291e = xVar;
        SharedFlow<PixivisionListEvent> b = C2518n.m7643b(0, 0, null, 7);
        this.f19292f = b;
        this.f19293g = new Share(b, null);
        C1124a.m10167y(Preconditions.m9807K(this), null, 0, new C4308a(null), 3, null);
    }
}
